﻿using System;
using System.Collections.Generic;
using UnityEngine;

// Token: 0x0200002D RID: 45
public class WeaponScript : MonoBehaviour
{
	// Token: 0x060000C3 RID: 195 RVA: 0x00010588 File Offset: 0x0000E788
	private void Start()
	{
		this.maxDurability = this.durability;
		this.rend = base.GetComponent<SpriteRenderer>();
		GameObject gameObject = new GameObject("Blood", new Type[]
		{
			typeof(SpriteRenderer)
		});
		gameObject.transform.parent = base.transform;
		this.blood = gameObject.GetComponent<SpriteRenderer>();
		this.blood.sprite = this.bloodSprite;
		this.blood.color = Color.clear;
		gameObject.transform.localPosition = Vector3.zero;
		gameObject.transform.localRotation = Quaternion.identity;
		gameObject.transform.localScale = Vector3.one;
	}

	// Token: 0x060000C4 RID: 196 RVA: 0x0001063C File Offset: 0x0000E83C
	private void Update()
	{
		this.clashTime -= Time.deltaTime;
		this.blood.sortingOrder = this.rend.sortingOrder + 1;
		if (this.durability <= 0f)
		{
			Object.Destroy(base.gameObject);
			Object.Destroy(Object.Instantiate(Resources.Load("BreakParticle"), base.transform.position, Quaternion.identity), 1f);
			Sound.Play(this.breakSound, base.transform.position, false, true, 1f);
			if (base.GetComponent<DamagingObject>().currentOwner)
			{
				base.GetComponent<DamagingObject>().currentOwner.DropWeapon();
			}
		}
	}

	// Token: 0x040001A2 RID: 418
	public float windupTime;

	// Token: 0x040001A3 RID: 419
	public Vector2 holdPoint1;

	// Token: 0x040001A4 RID: 420
	public Vector2 holdPoint2;

	// Token: 0x040001A5 RID: 421
	[Header("Animation")]
	public Vector2 windupOne1;

	// Token: 0x040001A6 RID: 422
	public Vector2 windupOne2;

	// Token: 0x040001A7 RID: 423
	public float windupOne1Rot;

	// Token: 0x040001A8 RID: 424
	public Vector2 attackOne1;

	// Token: 0x040001A9 RID: 425
	public Vector2 attackOne2;

	// Token: 0x040001AA RID: 426
	public float attackOne1Rot;

	// Token: 0x040001AB RID: 427
	public Vector2 windupTwo1;

	// Token: 0x040001AC RID: 428
	public Vector2 windupTwo2;

	// Token: 0x040001AD RID: 429
	public float windupTwo1Rot;

	// Token: 0x040001AE RID: 430
	public Vector2 attackTwo1;

	// Token: 0x040001AF RID: 431
	public Vector2 attackTwo2;

	// Token: 0x040001B0 RID: 432
	public float attackTwo1Rot;

	// Token: 0x040001B1 RID: 433
	public Vector2 idle1;

	// Token: 0x040001B2 RID: 434
	public Vector2 idle2;

	// Token: 0x040001B3 RID: 435
	public float idle1Rot;

	// Token: 0x040001B4 RID: 436
	public Vector2 block1;

	// Token: 0x040001B5 RID: 437
	public Vector2 block2;

	// Token: 0x040001B6 RID: 438
	public float block1Rot;

	// Token: 0x040001B7 RID: 439
	public bool dualWield;

	// Token: 0x040001B8 RID: 440
	public float desiredAttackTime;

	// Token: 0x040001B9 RID: 441
	[HideInInspector]
	public bool held;

	// Token: 0x040001BA RID: 442
	public float durability;

	// Token: 0x040001BB RID: 443
	[HideInInspector]
	public float maxDurability;

	// Token: 0x040001BC RID: 444
	public AudioClip breakSound;

	// Token: 0x040001BD RID: 445
	[HideInInspector]
	public float clashTime;

	// Token: 0x040001BE RID: 446
	public List<AudioClip> clashSounds = new List<AudioClip>();

	// Token: 0x040001BF RID: 447
	public Sprite bloodSprite;

	// Token: 0x040001C0 RID: 448
	[HideInInspector]
	public SpriteRenderer blood;

	// Token: 0x040001C1 RID: 449
	[HideInInspector]
	public SpriteRenderer rend;

	// Token: 0x040001C2 RID: 450
	[HideInInspector]
	public float bloodQuantity;

	// Token: 0x040001C3 RID: 451
	public bool pickupable = true;

	// Token: 0x040001C4 RID: 452
	[HideInInspector]
	public float damageMult = 1f;
}
